3.76 \(\int \frac {1+2 x+x^2}{(1+x^2)^2} \, dx\)

Optimal. Leaf size=12 \[ \tan ^{-1}(x)-\frac {1}{x^2+1} \]

[Out]

-1/(x^2+1)+arctan(x)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 22, normalized size of antiderivative = 1.83, number of steps used = 3, number of rules used = 3, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {27, 723, 203} \[ \tan ^{-1}(x)-\frac {(1-x) (x+1)}{2 \left (x^2+1\right )} \]

Antiderivative was successfully verified.

[In]

Int[(1 + 2*x + x^2)/(1 + x^2)^2,x]

[Out]

-((1 - x)*(1 + x))/(2*(1 + x^2)) + ArcTan[x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 723

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(a*e - c*d*x)*(a
 + c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] + Dist[((2*p + 3)*(c*d^2 + a*e^2))/(2*a*c*(p + 1)), Int[(d + e*x)^(m -
2)*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 2, 0] && Lt
Q[p, -1]

Rubi steps

\begin {align*} \int \frac {1+2 x+x^2}{\left (1+x^2\right )^2} \, dx &=\int \frac {(1+x)^2}{\left (1+x^2\right )^2} \, dx\\ &=-\frac {(1-x) (1+x)}{2 \left (1+x^2\right )}+\int \frac {1}{1+x^2} \, dx\\ &=-\frac {(1-x) (1+x)}{2 \left (1+x^2\right )}+\tan ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 12, normalized size = 1.00 \[ \tan ^{-1}(x)-\frac {1}{x^2+1} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + 2*x + x^2)/(1 + x^2)^2,x]

[Out]

-(1 + x^2)^(-1) + ArcTan[x]

________________________________________________________________________________________

fricas [A]  time = 1.04, size = 18, normalized size = 1.50 \[ \frac {{\left (x^{2} + 1\right )} \arctan \relax (x) - 1}{x^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="fricas")

[Out]

((x^2 + 1)*arctan(x) - 1)/(x^2 + 1)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 12, normalized size = 1.00 \[ -\frac {1}{x^{2} + 1} + \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="giac")

[Out]

-1/(x^2 + 1) + arctan(x)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 13, normalized size = 1.08 \[ \arctan \relax (x )-\frac {1}{x^{2}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+2*x+1)/(x^2+1)^2,x)

[Out]

-1/(x^2+1)+arctan(x)

________________________________________________________________________________________

maxima [A]  time = 0.95, size = 12, normalized size = 1.00 \[ -\frac {1}{x^{2} + 1} + \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="maxima")

[Out]

-1/(x^2 + 1) + arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 12, normalized size = 1.00 \[ \mathrm {atan}\relax (x)-\frac {1}{x^2+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*x + x^2 + 1)/(x^2 + 1)^2,x)

[Out]

atan(x) - 1/(x^2 + 1)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 8, normalized size = 0.67 \[ \operatorname {atan}{\relax (x )} - \frac {1}{x^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+2*x+1)/(x**2+1)**2,x)

[Out]

atan(x) - 1/(x**2 + 1)

________________________________________________________________________________________